/*
 * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <tuple>
#include <vector>

#include <nvimgcodec.h>

namespace nvimgcodec { namespace test { namespace {

// clang-format off
#define S_(STATUS) NVIMGCODEC_PROCESSING_STATUS_#STATUS
std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case1_with_force_format_true{
    //codec/batch_item->
    // |
    // V
    {NVIMGCODEC_PROCESSING_STATUS_SUCCESS, NVIMGCODEC_PROCESSING_STATUS_ORIENTATION_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_ORIENTATION_UNSUPPORTED},
    {                                     NVIMGCODEC_PROCESSING_STATUS_ROI_UNSUPPORTED,         NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED},
    {                                     NVIMGCODEC_PROCESSING_STATUS_SUCCESS,                 NVIMGCODEC_PROCESSING_STATUS_SUCCESS}};

std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case1_with_force_format_true{
    NVIMGCODEC_PROCESSING_STATUS_SUCCESS, NVIMGCODEC_PROCESSING_STATUS_SUCCESS, NVIMGCODEC_PROCESSING_STATUS_SUCCESS};

std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case1_with_force_format_false{
    //codec/batch_item->
    // |
    // V
    {NVIMGCODEC_PROCESSING_STATUS_SUCCESS, NVIMGCODEC_PROCESSING_STATUS_ORIENTATION_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_ORIENTATION_UNSUPPORTED},
    {},
    {}};

std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case1_with_force_format_false{
    NVIMGCODEC_PROCESSING_STATUS_SUCCESS, NVIMGCODEC_PROCESSING_STATUS_ORIENTATION_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_ORIENTATION_UNSUPPORTED};

std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case2_with_force_format_true{
    //codec/batch_item->
    // |
    // V
    {NVIMGCODEC_PROCESSING_STATUS_CODEC_UNSUPPORTED,    NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED,  NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED},
    {NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED,  NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED,     NVIMGCODEC_PROCESSING_STATUS_SAMPLE_FORMAT_UNSUPPORTED},
    {NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLE_TYPE_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_CODEC_UNSUPPORTED}};

std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case2_with_force_format_true{
    NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLE_TYPE_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_CODEC_UNSUPPORTED};

std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case2_with_force_format_false{
    //codec/batch_item->
    // |
    // V
   {NVIMGCODEC_PROCESSING_STATUS_CODEC_UNSUPPORTED,    NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED},
   {NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED,  NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED,    NVIMGCODEC_PROCESSING_STATUS_SAMPLE_FORMAT_UNSUPPORTED},
   {                                                  NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED,   NVIMGCODEC_PROCESSING_STATUS_SAMPLE_TYPE_UNSUPPORTED}};


std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case2_with_force_format_false{
    NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLE_TYPE_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLE_FORMAT_UNSUPPORTED};



std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case3_with_force_format_true{
    //codec/batch_item->
    // |
    // V
    {NVIMGCODEC_PROCESSING_STATUS_NUM_PLANES_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL,                     NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED,    NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED,   NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED ,  NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED}};

std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case3_with_force_format_true{
    NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED};

std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case3_with_force_format_false{
    //codec/batch_item->
    // |
    // V
    {NVIMGCODEC_PROCESSING_STATUS_NUM_PLANES_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL,                     NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {                                                    NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED}};

std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case3_with_force_format_false{
    NVIMGCODEC_PROCESSING_STATUS_NUM_PLANES_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED};



std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case4_with_force_format_true{
    //codec/batch_item->
    // |
    // V
    {NVIMGCODEC_PROCESSING_STATUS_NUM_PLANES_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL,                     NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED,    NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED,   NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED ,  NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_FAIL}};

std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case4_with_force_format_true{
    NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_FAIL};

std::vector<std::vector<nvimgcodecProcessingStatus_t>> statuses_to_return_case4_with_force_format_false{
    //codec/batch_item->
    // |
    // V
    {NVIMGCODEC_PROCESSING_STATUS_NUM_PLANES_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL,                     NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_FAIL},
    {NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED, NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_FAIL}};


std::vector<nvimgcodecProcessingStatus_t> statuses_to_expect_for_case4_with_force_format_false{
    NVIMGCODEC_PROCESSING_STATUS_NUM_PLANES_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED, 
    NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED, 
    NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED|NVIMGCODEC_PROCESSING_STATUS_FAIL};

// clang-format on
}}} // namespace nvimgcodec::test
